//
//  XiaoQiSettingController.m
//  SleepingElf
//
//  Created by karong on 2023/11/3.
//

#import "XiaoQiSettingController.h"
#import "BaseNaolingController.h"


@interface XiaoQiSettingController ()
@property (weak, nonatomic) IBOutlet UIButton *naolingBtn;

@end

@implementation XiaoQiSettingController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self refreshData];
    [self addObserver];
}

- (void)addObserver {
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshData) name:SESleepSettingNotification object:nil];
    
}

- (void)refreshData {
    [self.naolingBtn setTitle:appConfig.xiaoQiConfig.title forState:(UIControlStateNormal)];
}

- (IBAction)naolingAction:(id)sender {
    UIStoryboard * storyboard = [UIStoryboard storyboardWithName:@"SleepController" bundle:nil];
    BaseNaolingController * target = [storyboard instantiateViewControllerWithIdentifier:@"BaseNaolingController"];
    target.type = 1;
    [self.navigationController pushViewController:target animated:YES];
}

- (IBAction)speakerAction:(UIButton *)sender {
    sender.selected = !sender.selected;
}
@end
